function getParamByKey(key){
        //拿到url的查询字符串
        var params = location.search;
        params = params.substring(1);//去掉前面的'?'
        var paramArr = params.split("&");
        if(paramArr!=null && paramArr.length>0){
            for(var i=0;i<paramArr.length;i++){
                var item = paramArr[i];// id=1
                var itemArr = item.split("=");//id 1
                if(itemArr.length==2 && itemArr[0]==key){
                    return itemArr[1]; //返回value
                }
            }
        }

        return null;
}